﻿// Write a program that shows the sign (+ or -) of the product of three real numbers without calculating it.
// Use a sequence of if statements.


using System;

class PlusOrMinusOfProduct
{
    static void Main()
    {
        Console.Write("Enter first number: ");
        string numberStr1 = Console.ReadLine();
        double number1;
        while (!double.TryParse(numberStr1, out number1))
        {
            Console.Write("Invalid input! Please, enter your first number again : ");
            numberStr1 = Console.ReadLine();
        }

        Console.Write("Enter second number : ");
        string numberStr2 = Console.ReadLine();
        double number2;
        while (!double.TryParse(numberStr2, out number2))
        {
            Console.Write("Invalid input! Please, enter your second number again : ");
            numberStr2 = Console.ReadLine();
        }

        Console.Write("Enter third number : ");
        string numberStr3 = Console.ReadLine();
        double number3;
        while (!double.TryParse(numberStr3, out number3))
        {
            Console.Write("Invalid input! Please, enter your third number again : ");
            numberStr3 = Console.ReadLine();
        }

        if (number1 == 0 || number2 == 0 || number3 == 0)
        {
            Console.WriteLine("The product is 0.");
        }
        else
        {
            if ((number1 > 0 && number2 > 0 && number3 > 0) ||
                (number1 > 0 && number2 < 0 && number3 < 0) ||
                (number1 < 0 && number2 < 0 && number3 > 0) ||
                (number1 < 0 && number2 > 0 && number3 < 0))
            {
                Console.WriteLine("The sign of the product is +");
            }
            else if ((number1 < 0 && number2 < 0 && number3 < 0) ||
                     (number1 > 0 && number2 > 0 && number3 < 0) ||
                     (number1 > 0 && number2 < 0 && number3 > 0) ||
                     (number1 < 0 && number2 > 0 && number3 > 0))
            {
                Console.WriteLine("The sign of the product is -");
            }
            else
            {
                Console.WriteLine("Something went wrong.");
            }
        }
    }
}
